import turtle
import random
points=[[0,100],[0,125],[0,150]]
def tcs():
    turtle.clear()
    for i in range(len(points)):
        turtle.penup()
        turtle.goto(points[i])
        turtle.down()
        turtle.dot(20,'red')
    new_point = points[-1].copy()
    if c==1:
        new_point[1]+=25
    elif c==2:
        new_point[1]-=25
    elif c==3:
        new_point[0] += 25
    elif c==4:
        new_point[0] -= 25
    points.append(new_point)
    points.pop(0)
    turtle.ontimer(tcs,200)
def a():
    global c
    c=1
def b():
    global c
    c=2
def d():
    global c
    c=3
def e():
    global c
    c=4
turtle.onkeypress(a,'Up')
turtle.onkeypress(b,'Down')
turtle.onkeypress(d,'Right')
turtle.onkeypress(e,'Left')
c=1
turtle.listen()
turtle.tracer(False)
tcs()

turtle.done()